/*
 * This file is part of andExplorer, android.ovhoo.com
 * Copyright (C) 2007 Mohamed ZALIM <mzalim@ovhoo.com>
 *
 * andExplorer is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation; either version 3 of the License, or
 * (at your option) any later version.
 *
 * andExplorer is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program.  If not, see <http://www.gnu.org/licenses/gpl.html>.
 */
package com.ovhoo.android.fiveexplore;


import com.ovhoo.android.fiveexplore.R;
import com.ovhoo.android.file.CurentDirManager;
import com.ovhoo.android.file.FileInterface;
import com.ovhoo.android.file.MimeTypes;

import android.app.AlertDialog;
import android.app.Dialog;
import android.content.Context;
import android.content.DialogInterface;


public abstract class AbstractOpenFileDialog extends Dialog {
	
	protected CurentDirManager fileManager;
	protected FileInterface file; // The file to open
	protected AlertDialog alertDialog; // used to show alert messages
	
	protected MimeTypes mimeTypes;
	
	public AbstractOpenFileDialog(Context context, CurentDirManager fileManager, FileInterface file) {
		super(context);
		
		this.fileManager = fileManager;
		this.file = file;
		this.mimeTypes = MimeTypes.getInstance(context);
		
		this.buildAlertDialog(); // Build the alert dialog
		
	}
	
	protected abstract void buildUI();
	
	protected void buildAlertDialog(){
		//Instanciation of the alert dialog
		this.alertDialog = new AlertDialog.Builder(this.getContext()).create();
		//_alertDialog.setTitle(this.getTitle());
		this.alertDialog.setButton(this.getContext().getResources().getString(R.string.COMMON_STRINGS_MSG_OK), new DialogInterface.OnClickListener() {
		      public void onClick(DialogInterface dialog, int which) {
		        return;
		      } }); 
	}

}
